#coding=utf-8
import configparser
import os

filepath = os.path.dirname(os.path.dirname(__file__))+'/cofig/server.ini'

class HandleIni:
    def load_ini(self):
        '''
        加载ini文件内容
        :return: 
        '''
        cf = configparser.ConfigParser()
        cf.read('E:\PycharmProjects\pyrequests\config/server.ini')
        # print(cf)
        return cf

    def get_value(self,key,section=None):
        '''
        获取section中的key对应的value
        :param key:
        :param node:
        :return:
        '''
        cf = self.load_ini()
        if section == None:
            section='server'
        data = cf.get(section,key)
        return data


handleIni = HandleIni()
print(handleIni.get_value('host')+'/api/add_event/')
print('http://www.baidu.com'+'/login')


